package edu.uow.scsse.main.domain;

import java.util.List;
/**
 * Node in the graph
 * @author Tiancheng Zhang
 *
 */
public class Node {
	/**id**/
	int id;
	/**Name of the node*/
	String name;
	/**Type of node*/
	NodeType type;
	/*visited flag*/
	Boolean visitedFlag;
	/**Outgoing edges*/
	List<Edge> outgoingEdges;
	/**Incoming egdes*/
	List<Edge> inComingEdges;
	
	/**
	 * Constructor of Node
	 * @param name
	 * @param type
	 * @param outgoingEdges
	 * @param inComingEdges
	 */
	public Node(int id, String name, NodeType type, Boolean visitedFlag, List<Edge> outgoingEdges,
			List<Edge> inComingEdges) {
		this.id = id;
		this.name = name;
		this.type = type;
		this.visitedFlag = visitedFlag;
		this.outgoingEdges = outgoingEdges;
		this.inComingEdges = inComingEdges;
	}
	
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the type
	 */
	public NodeType getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(NodeType type) {
		this.type = type;
	}
	/**
	 * @return the visitedFlag
	 */
	public Boolean getVisitedFlag() {
		return visitedFlag;
	}

	/**
	 * @param visitedFlag the visitedFlag to set
	 */
	public void setVisitedFlag(Boolean visitedFlag) {
		this.visitedFlag = visitedFlag;
	}

	/**
	 * @return the outgoingEdges
	 */
	public List<Edge> getOutgoingEdges() {
		return outgoingEdges;
	}
	/**
	 * @param outgoingEdges the outgoingEdges to set
	 */
	public void setOutgoingEdges(List<Edge> outgoingEdges) {
		this.outgoingEdges = outgoingEdges;
	}
	/**
	 * @return the inComingEdges
	 */
	public List<Edge> getInComingEdges() {
		return inComingEdges;
	}
	/**
	 * @param inComingEdges the inComingEdges to set
	 */
	public void setInComingEdges(List<Edge> inComingEdges) {
		this.inComingEdges = inComingEdges;
	}
	
	/**
	 *Equals override 
	 */
	@Override
	public boolean equals(Object o)
	{
		Node otherNode = (Node)o;
		return this.id == otherNode.getId();

	}
}
